package com.toKnow.model.vo;

import com.toKnow.model.entity.ArticleComment;
import com.toKnow.model.entity.SourceComment;

import java.util.Date;

public class CommentVo {
    private Integer author_id;
    private Integer comment_id;
    private Integer like_times;
    private Date comment_date;
    private String author_name;
    private String content;
    private String avatar;

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Override
    public String toString() {
        return "CommentVo{" +
                "author_id=" + author_id +
                ", comment_id=" + comment_id +
                ", like_times=" + like_times +
                ", comment_date=" + comment_date +
                ", author_name='" + author_name + '\'' +
                ", content='" + content + '\'' +
                '}';
    }

    public Integer getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(Integer author_id) {
        this.author_id = author_id;
    }

    public Integer getComment_id() {
        return comment_id;
    }

    public void setComment_id(Integer comment_id) {
        this.comment_id = comment_id;
    }

    public Integer getLike_times() {
        return like_times;
    }

    public void setLike_times(Integer like_times) {
        this.like_times = like_times;
    }

    public Date getComment_date() {
        return comment_date;
    }

    public void setComment_date(Date comment_date) {
        this.comment_date = comment_date;
    }

    public String getAuthor_name() {
        return author_name;
    }

    public void setAuthor_name(String author_name) {
        this.author_name = author_name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public CommentVo() {
    }

    public CommentVo(Integer author_id, Integer comment_id, Integer like_times, Date comment_date, String author_name, String content) {
        this.author_id = author_id;
        this.comment_id = comment_id;
        this.like_times = like_times;
        this.comment_date = comment_date;
        this.author_name = author_name;
        this.content = content;
    }
    public CommentVo(ArticleComment articleComment) {
        this.author_id = articleComment.getUserId();
        this.comment_id = articleComment.getId();
        this.like_times = articleComment.getLikeNumber();
        this.comment_date = articleComment.getCommentDate();
        this.author_name = articleComment.getUserName();
        this.content = articleComment.getContent();
        this.avatar=articleComment.getAvatar();
    }
    public CommentVo(SourceComment sourceComment) {
        this.author_id = sourceComment.getUserId();
        this.comment_id = sourceComment.getId();
        this.like_times = sourceComment.getLikeNumber();
        this.comment_date = sourceComment.getCommentDate();
        this.author_name = sourceComment.getUserName();
        this.content = sourceComment.getContent();
        this.avatar=sourceComment.getAvatar();
    }
}
